<?php

include_once('datos/ReporteSmgDAL.php');
$sql = "Where s.idEmpresa = 1";
if (isset($_GET['array'])) {
    $sql .= " and s.numSolicitud in (" . $_GET['array'] . ")";
}

$repo = new ReporteSmgDAL();

$dataArray = $repo->obtenerRepoteArray($sql);
$cantidadFilas = count($dataArray);

if ($cantidadFilas < 1) {
    $dataArray = array();
}

header('Content-disposition: attachment; filename=SMG.txt');
header('Content-type: text/plain');

foreach ($dataArray as $value) {
    $final = $value; 
   echo $final, PHP_EOL;
}


?>
